# -*- encoding: utf-8 -*-
# @File    :   __init__.py
# @Time    :   2021/07/23 10:19:46
# @Author  :   wudongmin
# @Contact :   wudongmin@xroom.net
# @version   :  1.0

from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from datetime import datetime
from sqlalchemy import Column, DateTime
from app.config import config


engine = create_engine(config.get_database_config())
Base = declarative_base(engine)  # SQLORM基类
session = sessionmaker(engine)()  # 构建session对象

class TimestampMixin(object):
    created_at = Column(DateTime, default=datetime.now()) 
    updated_at = Column(DateTime)
    